<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="message.jieSuan.zhiFuDanMingXi"/></title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
</head>
<body class="skin-blue sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.jieSuan.zhiFuDanMingXi"/></h1>
         <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.jieSuan.zhiFuDanGuanLi"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.jieSuan.zhiFuDan"/><spring:message code="message.jqGrid.cz.audit"/></a></li>
        </ol>
    </section>
    <section class="content">
        <div class=" box box-success ">
            <form  class="form-horizontal" id="form"  method="post" >
            	<div class="box-body">
                    <div class="form-group form-group-xs">
                        <label for="techPos" class="col-sm-2 text-right"><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.yanZheng.bianMa"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-4 text-left">
                            ${obj.settlementCode}
                        </div>
                        <label for="techPosCertNo" class="col-sm-2 text-right"><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.listForm.mingCheng"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-4 text-left">
			              	  ${obj.settlementName}
                        </div>
                    </div> 
                    
                    <div class="form-group form-group-xs">
                    	<label for="position" class="col-sm-2 text-right"><spring:message code="message.jieSuan.zongTiaoMuShu"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-4 text-left">
	                 		   ${obj.totalOrders}
                        </div>
                        <label for="industry" class="col-sm-2 text-right"><spring:message code="message.jieSuan.zongJinE"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-4 text-left">
                            ${obj.totalAmount}
                        </div>
                    </div>
                            <div class="form-group form-group-xs">
                    	<label for="position" class="col-sm-2 text-right"><spring:message code="message.jieSuan.chuangJianShiJian"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-4 text-left">
	                 		   ${obj.createDatetime}
                        </div>
                        <label for="industry" class="col-sm-2 text-right"><spring:message code="message.jieSuan.chuangJianRen"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-4 text-left">
                           ${obj.createUser}
                        </div>
                    </div>
                 
                    <div class="form-group form-group-xs">
                          <label for="industry" class="col-sm-2 text-right"><spring:message code="message.lable.remark"/><spring:message code="message.yanZheng.maoHao"/></label>
                        <div class="col-sm-4 text-left">
                           ${obj.remarks}
                        </div>
                    </div>
                </div>
            </form>
        </div>
           <table class="jqgrid" id="gridlist"></table>
		        <div id="gridpage"></div>
		        <div class=" box box-warning bottongroup">
                    <a href="${ctx}/centerCheckPayment/toCenterCheckSetmentDetailList.html?paymentBillId=${paymentBillId}&settlementId=${settlementId2}" class="btn btn-default btn-sm"><spring:message code="message.button.getBackSpacing"/></a>
                </div>
    </section>
	<%@ include file="/WEB-INF/component/commonJS.jsp"%>
    <script type="text/javascript">
 
    
    $(function() {
		$("#gridlist").jqGrid(
				{   url : "getCenterSetPaymentDetailListData.html",
					mtype : "POST",
					datatype : "json",
					postData : {"settlementId":"${obj.settlementId}","paymentBillId":"${paymentBillId}"},
					autowidth : true,
					shrinkToFit: false,
					height : 270,
					colNames : [ 
					             '<spring:message code="message.jieSuan.zhiFuMingXi"/><spring:message code="message.lable.userType"/>',
					             '<spring:message code="message.model.peiSongQiYe"/>',
					             '<spring:message code="message.listForm.yaoPinBianMa"/>',
					             '<spring:message code="message.listForm.tongYongMing"/>',
	                               '<spring:message code="message.listForm.jiXing"/>',
	                               '<spring:message code="message.listForm.guiGe"/>',
	                               '<spring:message code="message.listForm.zhuanHuanXiShu"/>',
	                               '<spring:message code="message.listForm.baoZhuangDanWei"/>',
	                               '<spring:message code="message.listForm.caiZhi"/>',
	                               '<spring:message code="message.listForm.shengChanQiYe"/>',
	                               '<spring:message code="message.jieSuan.caiGouJia"/>',
	                               '<spring:message code="message.jieSuan.daoHuoShuLiang"/>'
					             ],
					colModel : [
								{name : 'bankAcctTransType',index : 'bankAcctTransType', width : 80,align : "center",sortable:false,
									formatter:function(cellvalue, options, row){
										var str = "";
										if(cellvalue == 1){
											str = "<spring:message code="message.jieSuan.zhiFuDan"/>";
										}else{
											str = "<spring:message code="message.jieSuan.tuiHuoDan"/>";
										}
										return str;
									}	
								},
   								{name : 'compName',index : 'compName', width : 200,align : "center",sortable:false,
									 formatter:function(cellvalue, options, row){
			                                return '<a href="javascript:showCompInfo(\''+ row.compId +'\');">'+cellvalue+'</a>';
			                            }
								},
								{name : 'drugCode',index : 'drugCode', width : 100,align : "center",sortable:false,
									  formatter:function(cellvalue, options, row){
			                                return '<a href="javascript:showDrugInfo(\''+ row.drugId +'\');">'+cellvalue+'</a>';
			                            }
								},
								{name : 'drugName',index : 'drugName', width : 80,align : "center",sortable:false},
								{name : 'formName',index : 'formName', width : 80,align : "center",sortable:false},
								{name : 'specName',index : 'specName', width : 80,align : "center",sortable:false},
								{name : 'factor',index : 'factor', width : 80,align : "center",sortable:false},
								{name : 'unit',index : 'unit', width : 40,align : "center",sortable:false},
								{name : 'materialName',index : 'materialName', width : 80,align : "center",sortable:false},									
								{name : 'prodCompName',index : 'prodCompName', width : 180,align : "center",sortable:false,
									   formatter:function(cellvalue, options, row){
			                                return '<a href="javascript:showCompInfo(\''+ row.prodCompId +'\');">'+cellvalue+'</a>';
			                            }
								},
								{name : 'proPrice',index : 'proPrice', width : 80,align : "right",sortable:false,
									formatter:function(cellvalue, options, row){
										return formatAmount(cellvalue, options, row);
									}
								},
								{name : 'recpCount',index : 'recpCount', width : 80,align : "center",sortable:false},
					],
					rownumbers : true,
					pager : "#gridpage",
					viewrecords : true,
					caption : "<spring:message code="message.jieSuan.zhiFuDanMingXi"/><spring:message code="message.listForm.lieBiao"/>",
					//序号宽度自动变化
	                gridComplete:function(){
	                    //序号列宽度自适应（参数为jqgridID）
	                    autoRNWidth("gridlist");
	                    //数据只有一条时默认选中（参数为jqgridID）
	                    selectByOneData("gridlist");
	                },
					jsonReader : {
						repeatitems : false,
						id : "ids"
					}
				});
		
		
		$("#gridlist").jqGrid('navGrid', '#gridpage', {add : false,edit : false,del : false,search : false,refresh : false});
		$(window).trigger("resize");
    });
    function CurentTime(now)  
	{       	         
	    var year = now.getFullYear();   
	    var month = now.getMonth() + 1; 
	    var day = now.getDate();     
	         
	    var hh = now.getHours();       
	    var mm = now.getMinutes(); 
	    var ss=now.getSeconds(); 
	    var clock = year + "-"; 
	    if(month < 10) clock += "0";         
	    clock += month + "-";  
	    if(day < 10) clock += "0";   
	    clock += day + " "; 		
	    return(clock);   
	}
    
    //医疗机构信息弹窗
    function showHospInfo(hospId) {
        $.HN.dialog.open({
            "id": "showHospInfo", 
            "title": "<spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.listForm.xinXi"/>", 
            "url": "${ctx}/stdHospInfo/hospInfoDetail.html?hospId="+hospId,
            "data": {}, 
            "width": 800, 
            "height": 400, 
            "closefunc":function() {
                
            }
        });
    }
    
    //药品信息弹窗
    function showDrugInfo(drugId) {
        $.HN.dialog.open({
            "id": "showDrugInfo", 
            "title": "<spring:message code="message.listForm.yaoPin"/><spring:message code="message.listForm.xinXi"/>", 
            "url": "${ctx}/stdDrug/drugInfoDetail.html?drugId="+drugId,
            "data": {}, 
            "width": 800, 
            "height": 400, 
            "closefunc":function() {
                
            }
        });
    }
    
    //生产企业信息弹窗
    function showCompInfo(prodCompId) {
        $.HN.dialog.open({
            "id": "showCompInfo", 
            "title": "<spring:message code="message.listForm.shengChanQiYe"/><spring:message code="message.listForm.xinXi"/>", 
            "url": "${ctx}/stdCompinfo/toStdCompinfoDetail.html?compId="+prodCompId,
            "data": {}, 
            "width": 800, 
            "height": 400, 
            "closefunc":function() {
                
            }
        });
    }
 </script>
</body>
</html>